<?php
/**
* Ward Delete
* @author: trungdt
* @version: 1.0
* 
* Change logs
*/

if (!defined('EXPONENT')) exit('');

$rings = null;
if (isset($_GET['id'])) {
	$rings = $db->selectObject('provinces_wards','id='.intval($_GET['id']));
}

if ($rings) {
    if (exponent_users_isAdmin() && exponent_users_isLoggedIn()){
		/**
        * WARNING: MUST REMOVE ALL RELATIVE items
        */
        //$db->delete('poll_answer','question_id='.$question->id);
		$db->delete("provinces_wards","id = {$rings->id}");
		exponent_flow_redirect();
	} else {
		echo SITE_403_HTML;
	}
} else {
	echo SITE_404_HTML;
}

?> 
